﻿using MMS.Api.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace MMS.Api.Areas.Admin.Controllers
{
    public class UserController : BaseController
    {
        #region 1.0 根据员工id查询权限  //http://localhost:16824/api/User/GetUserPermission
        public List<Model.Permission> GetUserPermission(int id)
        {
            return OpeCur.BLLSession.Employee.GetUserPermission(id).Select(o => o.ToPOCO()).ToList();
        }
        #endregion
        // http://localhost:16824/api/User/GetUserById/1

        #region 1.0 根据员工id查询员工信息  http://localhost:16824/api/User/GetUserById/1
        public MMS.Model.Employee GetUserById(int id)
        {
            var model = OpeCur.BLLSession.Employee.Where(o => o.EmpId == id).FirstOrDefault().ToPOCO();
            return model;
        }
        #endregion

        #region 1.0 根据员工EmpLoginName查询员工信息  http://localhost:16824/api/User/GetUserByName/id
        public MMS.Model.Employee GetUserByName(string id)
        {
            var model = OpeCur.BLLSession.Employee.Where(o => o.EmpLoginName == id).FirstOrDefault().ToPOCO();
            return model;
        }
        #endregion


       
      
       
       
       
    }
}
